<script type="text/javascript">
	$("#formGuestRoom").bind("submit", function() {
		$.ajax({
			type	: "POST",
			cache	: false,
			url		: "index.php?module=POBHotel&type=ajax&func=submit&ctrl=GuestRoom",
			data	: $(this).serializeArray(),
			success	: function(data) {
				
				$.facebox(data);
				$.facebox.close();
				callback_refresh();
			}
		});

		return false;
	});
	$("#formGuestRoom").bind("reset", function() {
				$.facebox.close();
				callback_refresh();
		return false;
	});
</script>

<legend><!--[pnml name="_POBHOTEL_AJAX_FORM_LEGEND_ADDGUESTROOM"]--></legend>
<FORM id="formGuestRoom" name="formGuestRoom" METHOD=POST ACTION="" enctype="multipart/form-data>">
						<input type="hidden" name="form[id]" value="<!--[$form.id]-->" />
						<!--[get_all_guest_room_type]-->
						<!--[get_all_season]-->
			
							<TABLE width="600">
								<tr>
								<td>
									<!--[pnml name="_POBHOTEL_AJAX_FORM_LEGEND_ADDGUESTROOM_TYPE"]-->
									<select name="form[type_id]">
										<!--[foreach from=$guestRoomTypeArray item=itemAllGuestRoomType name=foo]-->
										  <!--[if $form.type_id eq $itemAllGuestRoomType.guest_room_type_id]-->
											<option value="<!--[$itemAllGuestRoomType.guest_room_type_id]-->" SELECTED><!--[$itemAllGuestRoomType.guest_room_type_name]--></option>
										  <!--[else]-->
											<option value="<!--[$itemAllGuestRoomType.guest_room_type_id]-->"><!--[$itemAllGuestRoomType.guest_room_type_name]--></option>
										  <!--[/if]-->
										<!--[/foreach]-->
									</select>
								</td>
								</tr>
								<tr>
								<td>
									<!--[pnml name="_POBHOTEL_AJAX_FORM_LEGEND_ADDGUESTROOM_QUANTITY"]-->
									<INPUT TYPE="text" NAME="form[limit]" ROWS="10" COLS="40" size="10" value="<!--[$form.limit]-->">
								</td>
								</tr>
								<tr>
								<td>
									<!--[pnml name="_POBHOTEL_AJAX_FORM_LEGEND_ADDGUESTROOM_SEASON"]-->
									<select name="form[season_id]">
										<!--[foreach from=$seasonArray item=itemAllSeason name=foo]-->
										  <!--[if $form.season_id eq $itemAllSeason.season_id]-->
											<option value="<!--[$itemAllSeason.season_id]-->" SELECTED><!--[$itemAllSeason.season_name]--></option>
										  <!--[else]-->
											<option value="<!--[$itemAllSeason.season_id]-->"><!--[$itemAllSeason.season_name]--></option>
										  <!--[/if]-->
										<!--[/foreach]-->
									</select>
								</td>
								</tr>
								<tr>
								<td>
									<!--[pnml name="_POBHOTEL_AJAX_FORM_LEGEND_ADDGUESTROOM_PRICE"]-->
									<INPUT TYPE="text" NAME="form[price]" ROWS="10" COLS="40" size="30" value="<!--[$form.price]-->">
								</td>
								</tr>
								<tr>
								<td>
									<!--[pnml name="_POBHOTEL_AJAX_FORM_LEGEND_ADDGUESTROOM_CAPACITY"]-->
									<INPUT TYPE="text" NAME="form[capacity]" ROWS="10" COLS="40" size="30" value="<!--[$form.capacity]-->">
								</td>
								</tr>
							<tr>
							<td>
							<button id="registerButton" type="submit"><!--[pnml name="_POBHOTEL_AJAX_FORM_LEGEND_ADDGUESTROOM_SUBMIT"]--></button> <button id="resetButton" type="reset"><!--[pnml name="_POBHOTEL_AJAX_FORM_LEGEND_ADDGUESTROOM_CANCEL"]--></button>
							</td>
							</tr>
							</TABLE>
</FORM>